-- ----------------------------- 2023-07-06 add by jiangjl@sunwayoworld.com--------------begin

-- 建表语句
CREATE TABLE T_LIMS_PJ_METHOD( 
    ID NUMBER NOT NULL,
    METHODCODE VARCHAR2(66)  NULL,
    METHODDESC VARCHAR2(300)  NULL,
    METHODTYPE VARCHAR2(66)  NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_PJ_METHOD IS '普检方法表';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.ID IS '主键';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.METHODCODE IS 'SOP编号';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.METHODDESC IS '方法描述';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.METHODTYPE IS '类别';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_PJ_METHOD.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_PJ_METHOD ADD CONSTRAINT PK_LIMS_PJ_METHOD PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODCODE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODDESC','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODTYPE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODCODE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODDESC','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','METHODTYPE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD','CREATEDBYORGNAME','1');
COMMIT;
CREATE TABLE T_LIMS_PJ_METHOD_VERSION( 
    ID NUMBER NOT NULL,
    METHODID NUMBER(21)  NULL,
    METHODCODE VARCHAR2(66)  NULL,
    METHODVERSION VARCHAR2(33)  NULL,
    METHODVERSIONDESC VARCHAR2(300)  NULL,
    STARTDATE DATE NULL,
    EXPDATE DATE NULL,
    RELEASEDATE DATE NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_PJ_METHOD_VERSION IS '普检方法版本表';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.ID IS '主键';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.METHODID IS '普检方法表ID';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.METHODCODE IS 'sop编号';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.METHODVERSION IS '版本号';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.METHODVERSIONDESC IS '版本描述';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.STARTDATE IS '开始日期';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.EXPDATE IS '作废日期';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.RELEASEDATE IS '发布日期';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_PJ_METHOD_VERSION.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_PJ_METHOD_VERSION ADD CONSTRAINT PK_LIMS_PJ_METHOD_VERSION PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODCODE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODVERSION','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODVERSIONDESC','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','STARTDATE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','EXPDATE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','RELEASEDATE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODCODE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODVERSION','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','METHODVERSIONDESC','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','STARTDATE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','EXPDATE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','RELEASEDATE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_PJ_METHOD_VERSION','CREATEDBYORGNAME','1');
COMMIT;
CALL INSERTI18N('T_LIMS_PJ_METHOD.SERVICE_NAME', '普检方法表', '普检方法表', 'zh-CN', '普检方法表');
CALL INSERTI18N('T_LIMS_PJ_METHOD.ID', '普检方法表的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_PJ_METHOD.METHODCODE', '普检方法表的SOP编号', 'SOP编号', 'zh-CN', 'SOP编号');
CALL INSERTI18N('T_LIMS_PJ_METHOD.METHODDESC', '普检方法表的方法描述', '方法描述', 'zh-CN', '方法描述');
CALL INSERTI18N('T_LIMS_PJ_METHOD.METHODTYPE', '普检方法表的类别', '类别', 'zh-CN', '类别');
CALL INSERTI18N('T_LIMS_PJ_METHOD.CREATEDBYID', '普检方法表的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_PJ_METHOD.CREATEDBYNAME', '普检方法表的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_PJ_METHOD.CREATEDTIME', '普检方法表的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_PJ_METHOD.CREATEDBYORGID', '普检方法表的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_PJ_METHOD.CREATEDBYORGNAME', '普检方法表的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.SERVICE_NAME', '普检方法版本表', '普检方法版本表', 'zh-CN', '普检方法版本表');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.ID', '普检方法版本表的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.METHODID', '普检方法版本表的普检方法表ID', '普检方法表ID', 'zh-CN', '普检方法表ID');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.METHODCODE', '普检方法版本表的sop编号', 'sop编号', 'zh-CN', 'sop编号');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.METHODVERSION', '普检方法版本表的版本号', '版本号', 'zh-CN', '版本号');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.METHODVERSIONDESC', '普检方法版本表的版本描述', '版本描述', 'zh-CN', '版本描述');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.STARTDATE', '普检方法版本表的开始日期', '开始日期', 'zh-CN', '开始日期');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.EXPDATE', '普检方法版本表的作废日期', '作废日期', 'zh-CN', '作废日期');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.RELEASEDATE', '普检方法版本表的发布日期', '发布日期', 'zh-CN', '发布日期');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.CREATEDBYID', '普检方法版本表的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.CREATEDBYNAME', '普检方法版本表的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.CREATEDTIME', '普检方法版本表的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.CREATEDBYORGID', '普检方法版本表的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_PJ_METHOD_VERSION.CREATEDBYORGNAME', '普检方法版本表的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('BASEMODULE.COREDATA.PJMETHODS.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.COREDATA.PJMETHODS.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.COREDATA.PJMETHODS.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.COREDATA.PJMETHODS.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.COREDATA.PJMETHODS.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');

-- 创建菜单语句
INSERT INTO T_CORE_MENU (ID, MENUNAME, HREF, PARENTID, ORDERNO, ICON, MENUINITNAME)
VALUES ('2023070601', '普检-SOP管理', '/secure/basemodule/coredata/pj-method-versions/page/edit-list', 'null', '2023070601', 'null', '普检-SOP管理');

INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_PJ_METHOD', '0', '0');
INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_PJ_METHOD_VERSION', '0', '0');


COMMIT;

-- ----------------------------- 2023-07-06 add by jiangjl@sunwayoworld.com------------end